const Dotenv = require('dotenv-webpack');

module.exports = {
    configureWebpack: {
        devtool: 'source-map',
        plugins: [
            // 注入process.env
            new webpack.DefinePlugin({
                'process.env': JSON.stringify(process.env),
            }),
            // 加载.env文件（可选，如需环境变量文件）
            new Dotenv(),
            // 提供process的浏览器polyfill
            new webpack.ProvidePlugin({
                process: 'process/browser',
            }),
        ],
        resolve: {
            fallback: {
                "process": require.resolve("process/browser"),
            }
        }
    },

    devServer: {
        disableHostCheck: true,
        useLocalIp: true
    },

    transpileDependencies: ['vuetify'],

    pluginOptions: {
        i18n: {
            locale: 'en',
            fallbackLocale: 'en',
            localeDir: 'locales',
            enableInSFC: false,
        },
    },
}

